//Day 04-1

#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int* findErrorNums(int* nums, int sz, int* returnSize)
{
	int i = 0;
	int j = 0;
	int count = 0;
	for (i = 0; i < sz - 1; i++)
	{
		for (j = i; j < sz - 1; j++)
		{
			if (nums[i] == nums[j + 1])
			{
				returnSize[0] = nums[i];
				count = nums[j];
				returnSize[1] = count + 1;
				break;
			}//end if
		}
	}//end of for
	return returnSize;
}

int main()
{
	int nums[] = { 1,2,3,4,5,6,4,8 };
	int returnSize[2] = { 0 };
	int sz = sizeof(nums) / sizeof(int);
	int* p = findErrorNums(nums, sz, returnSize);
	
	int i = 0;
	for (i = 0; i < 2; i++)
	{
		printf("%d ",*(p + i));
	}
	return 0;
}